#@layout()

#define script()
<script>

    function doDel(id) {
        if (confirm("确定要删除该回复吗？删除后不可恢复")) {
            ajaxGet("#(CPATH)/admin/wechat/doDelReply/" + id);
        }
    }

</script>

#end


#define content()
    <section class="content-header">

        <div class="container-fluid">
            <div class="row">
                <div class="col-sm-6">

                    <div class="row mb-2">
                        <div class="col-sm-12">
                            <h1>
                                自动回复
                                <small data-toggle="tooltip" title="" data-placement="right"
                                       data-trigger="hover"><i class="nav-icon far fa-question-circle"></i></small>
                                <small> 首页 / 微信 / 自动回复</small>
                            </h1>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6 ">
                    <div class=" float-sm-right" style="padding-top: 45px">
                        <a href="#(CPATH)/admin/wechat/keyword/write" class="btn btn-primary "> <i class="fas fa-plus"></i> 新建</a>
                    </div>
                </div>
            </div>

        </div><!-- /.container-fluid -->


    </section>


    <section class="content">

        <div class="container-fluid">
                <div class="card card-outline card-primary">
                    <div class="card-header with-border">
                        <form class=" admin-search-panel" action="" method="get">
                            <div class="row">
                                <div class="form-group col-lg-2">
                                        <input type="text" placeholder="关键字" class="form-control" name="keyword"
                                               value="#para('keyword')">
                                </div>
                                <div class="form-group col-lg-2">
                                        <input type="text" placeholder="内容" class="form-control" name="content" value="#para('content')">
                                </div>
                                <div class="form-group col-lg-2">
                                        <button type="submit" class="btn btn-primary ">查询</button>
                                        <button type="reset" class="btn btn-default">重置</button>
                                </div>
                            </div>
                            <!-- /.card-body -->
                        </form>

                    </div>
                    <!-- /.card-header -->
                    <div class="card-body p-0">

                        <table class="table table-striped">
                            <tbody>
                            <tr>
                                <th style="width: 10px">
                                    <input class="tableCheckAll" id="checkall" type="checkbox" value="0"/>
                                </th>
                                <th style="width: 450px">关键字</th>
                                <th style="width: 450px">回复类型</th>
                                <th>回复内容</th>
                                <th style="width: 100px">发布时间</th>
                            </tr>

                            #for(reply : page.list)
                            <tr>
                                <td><input name="tableItem" type="checkbox" value="#(reply.id)" />
                                </td>
                                <td>
                                    <strong>
                                        <a href="#(CPATH)/admin/wechat/keyword/write/#(reply.id)">
                                            #(reply.keyword ??)
                                        </a>
                                    </strong>
                                    <div class="jp-action-card">
                                        <div class="jp-action-body">
                                            <a href="#(CPATH)/admin/wechat/keyword/write/#(reply.id)" >编辑</a> |
                                            <a href="javascript:;" onclick="doDel('#(reply.id??)')"
                                               style="color: #a00">删除</a>
                                        </div>
                                    </div>

                                </td>
                                <td>#(reply.replyTypeStr ??)</td>
                                <td>#(reply.showContent ??)</td>
                                <td>#(reply.created ??)</td>
                            </tr>
                            #else
                            <tr class="nodata"><td colspan="999">暂无数据</td> </tr>
                            #end

                            </tbody>
                        </table>
                    </div>
                    <!-- /.card-body -->
                    <div class="card-footer">
                        <div class="row">
                            <div class="col-sm-6">
                                <div class="row">

                                    <div class="form-group">
                                        <div class="form-check">
                                            <input class="form-check-input tableCheckAll" id="checkall" type="checkbox" >
                                            <label class="form-check-label" for="checkall">全选</label>
                                        </div>
                                    </div>
                                    <div class="form-group col-lg-3">
                                        <select class="form-control" name="action">
                                            <option value="">请选择...</option>
                                            <option value="doDelByIds" open-type="del-confirm">
                                                批量删除
                                            </option>
                                        </select>
                                    </div>

                                    <div class="form-group col-lg-3">
                                        <button type="button" class="btn btn-outline-primary batchExec">批量操作</button>
                                    </div>
                                </div>
                            </div>

                            <div class="col-sm-6">
                                #@_paginate()
                            </div>
                        </div>
                    </div>
                    <!-- /.card-footer -->
                </div>
                <!-- /.card -->
            </div>
    </section>
#end
